The invention relates to a computer such as an MCU (Micro Controller Unit) which can be built into various types of electronic equipment, and particularly relates to an interrupt program module for performing a monitoring function for the computer.
MCU, Among MCUs which are typically used as so-called one-chip microcomputers, there is a type of MCU which includes an on-chip debugging function for implementing a process of debugging the program residing on the chip. According to the on-chip debugging function, the internal state of the MCU can be monitored from an external device without using an expensive emulator, thereby analyzing a program fault.
When utilizing such a monitoring function, the MCU can be connected to an external monitoring unit so as to communicate via a communication mechanism such as a conventionally well known UART (Universal Asynchronous Receiver/Transmitter). When the monitoring function is performed, information read from a memory device such as a RAM (Random Access Memory), a ROM (Read Only Memory), or an SFR (Special Function Register) residing in the MCU are appropriately supplied to and analyzed by the monitoring unit.
Meanwhile, the program of the MCU set forth above is generally provided with a plurality of processing loops each constituting a loop, wherein each processing loop is selectively implemented via a branch decision step. Each processing loop is provided with one or plural program modules for implementing one or plural processing steps capable of executing a series of processes. When the processing steps terminate, a program returns to the branch decision step by an instruction of the loop. It is possible to monitor the state of each desired processing loop to be implemented immediately before returning to the branch decision by inserting the program module for such a monitoring function into processing loops to be parallel therewith, namely, by selectively inserting the program module as a decision branch in the branch decision step.
However, according to the conventional program, since the processing loop or other loops for monitoring function can be selectively implemented via the branch, for example, even if it is intended to investigate the state of processing loops comprising a plurality of processing steps before or after each step is implemented, it is impossible to move to the monitoring function during the implementation of the processing loops.
Further, in cases where the program module falls into an uncontrolled state which stops the proceeding of the loop during the execution of the processing loop, it is impossible to perform the monitoring function because the return to the branch decision step is prevented.